//
//  PieChart.m
//  MUBATE
//
//  Created by sunbin on 2017/2/13.
//  Copyright © 2017年 Quanli. All rights reserved.
//

#import "PieChart.h"
#import "CircleView.h"

@interface PieChart()
@property(nonatomic , strong) CircleView *circleView_one;

@property (weak, nonatomic) IBOutlet UIView *chartView;

@end
@implementation PieChart
{
}
- (void)awakeFromNib {
    [super awakeFromNib];
    //添加圆形比例图
    [_chartView addSubview:self.circleView_one];

}
- (void)PieChartData:(NSDictionary *)dic{
    self.circleView_one.dataArray = [[NSMutableArray alloc]initWithArray:@[@[
                                                                               @{@"number":@"20",@"color":@"00b0ec",@"name":@"信托产品"},
                                                                               @{@"number":@"200",@"color":@"e94f25",@"name":@"粤财汇"},
                                                                               @{@"number":@"100",@"color":@"006db8",@"name":@"投资"}
                                                                               ],
                                                                           @[
                                                                               @{@"number":@"200",@"color":@"00b0ec",@"name":@"信托产品"},
                                                                               @{@"number":@"200",@"color":@"e94f25",@"name":@"粤财汇"},
                                                                               @{@"number":@"100",@"color":@"006db8",@"name":@"投资"}
                                                                               ]][arc4random()%2]
                                     ];
    
}








- (CircleView *)circleView_one{
    if (!_circleView_one) {
        _circleView_one = [[CircleView alloc]initWithFrame:CGRectMake(0, 0, kscaleHeight(WIDTH(_chartView)), kscaleHeight(HEIGHT(_chartView))) andUrlStr:@"融资"];
    }
    return _circleView_one;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
